/*
 * @description: sku商品管理
 * @author: Flechaxo
 * @date: 2024-07-05 11:02:08
 * @version: V1.0.5
 */

import request from '@/utils/request'

enum API {
  // sku商品列表
  SKULIST = '/admin/product/list/',
  // 获取sku商品详情页接口
  SKUINFO = '/admin/product/getSkuInfo/',
  // 删除某个sku商品
  DELETESKU = '/admin/product/deleteSku/',
  //下架的接口
  CANCELSALE_URL = '/admin/product/cancelSale/',
  //上架的接口
  SALE_URL = '/admin/product/onSale/',
}

// 获取sku商品列表页数据
export const getSKUList = (page: number, limit: number) =>
  request.get(API.SKULIST + `${page}/${limit}`)
// 获取sku商品详情页接口
export const getSKUInfo = (skuId: number) => request.get(API.SKUINFO + skuId)
// 删除某个sku商品
export const deleteSKU = (skuId: number) =>
  request.delete(API.DELETESKU + skuId)
// sku商品的下架
export const cancelSaleAPI = (skuId: number) =>
  request.get(API.CANCELSALE_URL + skuId)
// sku商品的上架
export const saleSkuAPI = (skuId: number) => request.get(API.SALE_URL + skuId)
